package com.nrzt;

import java.io.IOException;

import javax.servlet.jsp.JspContext;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.JspFragment;
import javax.servlet.jsp.tagext.JspTag;
import javax.servlet.jsp.tagext.SimpleTag;

public class HelloTag implements SimpleTag {
	private JspTag parent;
	private PageContext pageContext;
	private JspFragment jspBody;
	//标签执行方法
	@Override
	public void doTag() throws JspException, IOException {
		pageContext.getOut().print("Hello Tag!!!");
		System.out.println("--------------doTag()---------------------");

	}
	//获取父标签
	@Override
	public JspTag getParent() {
		System.out.println("--------------getParent()---------------------");
		return this.parent;
	}
	//设置标签体对象
	@Override
	public void setJspBody(JspFragment arg0) {
		System.out.println("--------------setJspBody()---------------------");
		this.jspBody = jspBody;

	}
	//设置PageContext
	@Override
	public void setJspContext(JspContext pc) {
		this.pageContext = (PageContext) pc;
		System.out.println("--------------setJspContext()---------------------");

	}
	//设置父标签
	@Override
	public void setParent(JspTag arg0) {
		this.parent = parent;
		System.out.println("--------------setParent()---------------------");

	}

}
